﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Crude.Core;

namespace Crude.ThirdPartyTool
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();
            openFileDialog.Multiselect = true;
            openFileDialog.Title = "Choose third party assemblies...";
            openFileDialog.Filter = "DLL Assemblies (*.dll)|*.dll|EXE Assemblies (*.exe)|*.exe|All Files (*.*)|*.*";

            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                ThirdPartyAssembliesTool thirdPartyAssembliesTool = new ThirdPartyAssembliesTool();

                try
                {
                    thirdPartyAssembliesTool.PublishAssemblies(openFileDialog.FileNames);
                    MessageBox.Show("Publish assemblies completed", "Crude", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(string.Format("Publish assemblies failtd\n{0}", ex.ToString()), "Crude",MessageBoxButtons.OK,MessageBoxIcon.Error);
                }
                

                
            }
        }
    }
}
